#include "LoginView.h"


LoginView::LoginView(void)
	:_ui( nullptr )
	,_startBtn( nullptr )
{
}


LoginView::~LoginView(void)
{
}

bool LoginView::init()
{
	if ( !Layer::init() ){ return false; }

	Size size = ModuleMgr::inst()->getGameViewSize();

	 _ui = cocostudio::GUIReader::getInstance()->widgetFromJsonFile("ui/main_menu_1/main_menu_1.ExportJson"); 
	 Size uiSize = _ui->getContentSize();
	 uiSize.width = (size.width - uiSize.width)/2;
	 uiSize.height =  (size.height - uiSize.height)/2;
	 _ui->setPosition( Point( uiSize ) );
	 addChild(_ui);  

	 _startBtn = dynamic_cast<Button*>( _ui->getChildByTag( 2 ) );

	return true;
}
